import Layout from '@/layout/index.vue';

export const constantRoutes: RouteRecordable[] = [
  {
    path: '/redirect',
    component: Layout,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/pages/redirect/index.vue'),
      },
    ],
    hidden: true,
  },
  {
    path: '/social-callback',
    component: () => import('@/layout/components/social-callback/index.vue'),
    hidden: true,
  },
  {
    path: '/login',
    component: () => import('@/pages/login/index.vue'),
    hidden: true,
  },
  {
    path: '/register',
    component: () => import('@/pages/register/index.vue'),
    hidden: true,
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/pages/error/404.vue'),
    hidden: true,
  },
  {
    path: '/403',
    component: () => import('@/pages/error/403.vue'),
    hidden: true,
  },
  {
    path: '',
    component: Layout,
    redirect: '/index',
    children: [
      {
        path: '/index',
        component: () => import('@/pages/index/index.vue'),
        name: 'Index',
        meta: { title: '工作台', icon: 'svg__kafei' },
      },
    ],
    meta: { title: '工作台', icon: 'svg__kafei', affix: true },
  },
];
